import java.util.Scanner;

/**
 * Created with IntelliJ IDEA.
 * Description:
 * User: 666
 * Date: 2023-03-20
 * Time: 17:45
 */
public class Test3 {
    public static void main(String[] args) {
        Scanner q=new Scanner(System.in);
        String str1=q.nextLine();
        char[] arr1=new  char[str1.length()];
        String str2=q.nextLine();
        char[] arr2=new  char[str2.length()];
        int a=(str1.length()>str2.length())?str1.length() : str2.length();
        char[] arr3=new char[a];
        for (int i = 0; i < str1.length(); i++) {
           arr1[i]=str1.charAt(i);
        }
        for (int i = 0; i < str2.length(); i++) {
            arr2[i]=str2.charAt(i);
        }
        int c=0;
        for (int i = 0; i < str1.length(); i++) {
            int j=0;
            for ( j = 0; j < str2.length(); j++) {
                if(arr1[i]==arr2[j]){
                    break;
                }
            }
            if(j==str2.length()){
                arr3[c++]=arr1[i];
            }
        }
        for (int i = 0; i < c; i++) {
            System.out.print(arr3[i]);
        }
    }
}
